<template>
  <div id="app">
    <!--4. 使用组件   :key需要绑定一个下标 确定身份
    :goods将goods的值绑定到abc标签 -->
    <Goods v-for="(abc, index) in goodslist" :key="index" :goods="abc"> </Goods>
  </div>
</template>

<script>
//2. 导入组件
import Goods from "./components/goods.vue";

export default {
  name: "App",
  components: {
    //3. 注册组件
    Goods,
  },
  // 还是用函数接收
  data() {
    return {
      goodslist: [
        { name: "观念论", price: 20 },
        { name: "现象学", price: 40 },
        { name: "存在与时间", price: 50 },
      ],
    };
  },
};
</script>

<style>
</style>
